<?php
function __autoload($class) {
    echo "<br>autoload with $class";

    if (false === require_once($class . ".php")) {
        if (false === require_once($documentRoot . "includes/" . $class . ".php")) {
            die('no file has been found arround');
        }
    }

    if (!class_exists($class)) {//true === strchr($class, "_")) {
        $class = str_replace("_","/", $class);
        if (false === require_once($documentRoot . "/" . $class . ".php")) {
            if (false === require_once($documentRoot . "includes/" . $class . ".php")) {
                die('no file has been found arround');
            }
        }
    }
}

header("Cache-Control: no-cache");
header("Pragma: no-cache");

$documentRoot = $_SERVER['DOCUMENT_ROOT'] . "/Game/";
echo $documentRoot;

define('SMARTY_DIR', 'd:/Programme/Xampp/smarty/');
require(SMARTY_DIR . 'Smarty.class.php');
spl_autoload_register('__autoload');
    